﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using DAL;
using BLL;
using CTRL;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            BatteryCenter Sofia = new BatteryCenter() { name = "Sofia" };
            BatteryCenter Plovdiv = new BatteryCenter() { name = "Plovdiv" };
            BatteryCenter StaraZagora = new BatteryCenter() { name = "Stara Zagora" };
            BatteryCenter Pleven = new BatteryCenter() { name = "Pleven" };
            BatteryCenter Ruse = new BatteryCenter() { name = "Ruse" };
            BatteryCenter Burgas = new BatteryCenter() { name = "Burgas" };
            BatteryCenter Varna = new BatteryCenter() { name = "Varna" };
            BatteryCenter Gabrovo = new BatteryCenter() { name = "Gabrovo" };
            BatteryCenter Vraca = new BatteryCenter() { name = "Vraca" };
            BatteryCenter Sozopol = new BatteryCenter() { name = "Sozopol" };

            Map Bulgaria = new Map();

            Bulgaria.AddStation(Sofia);
            Bulgaria.AddStation(Plovdiv);
            Bulgaria.AddStation(StaraZagora);
            Bulgaria.AddStation(Pleven);
            Bulgaria.AddStation(Ruse);
            Bulgaria.AddStation(Burgas);
            Bulgaria.AddStation(Varna);
            Bulgaria.AddStation(Gabrovo);
            Bulgaria.AddStation(Vraca);
            Bulgaria.AddStation(Sozopol);

            Bulgaria.AddEdge(Sofia, Vraca, 111.0);
            Bulgaria.AddEdge(Sofia, Plovdiv, 156.0);
            Bulgaria.AddEdge(Plovdiv, StaraZagora, 88.0);
            Bulgaria.AddEdge(StaraZagora, Burgas, 184.0);
            Bulgaria.AddEdge(StaraZagora, Gabrovo, 82.0);
            Bulgaria.AddEdge(Burgas, Varna, 122.0);
            Bulgaria.AddEdge(Burgas, Sozopol, 30.0);
            Bulgaria.AddEdge(Plovdiv, Gabrovo, 148.0);
            Bulgaria.AddEdge(Gabrovo, Pleven, 100.0);
            Bulgaria.AddEdge(Pleven, Ruse, 148.0);
            Bulgaria.AddEdge(Pleven, Varna, 300.0);
            Bulgaria.AddEdge(Ruse, Varna, 195.0);

            PathFinder boo = new PathFinder();

            var a = boo.FindPathFromCityToCity(Bulgaria, Sozopol, Sofia, 200);
            var distance = 0.0;
            foreach(var b in a)
            {
                Console.WriteLine("{0} {1}", b.BatteryCenter.name, b.Distance);
                distance += b.Distance;
            }
            Console.WriteLine("Total {0}km", distance.ToString());

            Console.ReadLine();
        }
    }
}